<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>template demo</title>
    <link rel="stylesheet" href="//www.changyou.com/cdn/css/1.0/index.min.css">
    <link rel="stylesheet" href="./index.css">
</head>
<body>
<section class="gift_wrap text-center main_content"></section>
</body>
<script type="text/html" id="GiftList">
    <ul class="gift_list">
        <%for(var i = 0; i < list.length; i++) {%>
        <%var item = list[i];%>
        <li class="row">
            <div class="title"><img src='<%:u=imgBase + "title" + (i + 1) + ".png"%>' alt=""></div>
            <div class="list">
                <%for(var j = 0; j < item.list.length; j++) {%>
                <%var info = item.list[j];%>
                <div class="item">
                    <div class="img"><img src='<%:u=imgBase + info.picture + ".png"%>' alt=""></div>
                    <p class="name"><%:=info.name%></p>
                </div>
                <%}%>
            </div>
            <a href="javascript:;" class="btn_get_gift">立即领取</a>
        </li>
        <%}%>
    </ul>
    <a href="http://chong.changyou.com/renew/commonChong.do?gameType=42&from=pt" target="_blank" class="btn_recharge">立即充值</a>
</script>
<script src="//www.changyou.com/cdn/jquery/3.4.1/jquery.min.js"></script>
<script src="//www.changyou.com/cdn/template_js/0.7.1/template.min.js"></script>
<script>
    $.get('./gift.json', function(res) {
        var eleList = template($('#GiftList').html(), {
            imgBase: '/act/wf/recharge/20190822/pc/img/',
            list: res
        });
        $('.gift_wrap').html(eleList);
    });
</script>
</html>